# -*- coding: utf-8 -*-
"""
WLTP signals

"""

from bms import Signal


class WLTP1(Signal):
    """
    WLTP classe 1 cycle
    Caution! speed in m/s, not in km/h!
    """

    def __init__(self, name):
        Signal.__init__(self, name)
        self.data = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.05, 0.86, 1.58, 2.22, 2.8, 3.33, 3.83, 4.27,
                     4.63, 4.91, 5.08, 5.22, 5.24, 5.11, 4.69, 3.97, 3.0, 1.97,
                     1.11, 0.0, 0.0, 0.0, 0.0, 0.41, 1.05, 1.55, 2.08, 2.55,
                     3.0, 3.44, 3.83, 4.22, 4.52, 4.8, 5.0, 5.22, 5.41, 5.61,
                     5.8, 6.02, 6.22, 6.41, 6.58, 6.77, 6.97, 7.05, 7.0, 6.49,
                     6.05, 5.47, 4.8, 4.08, 3.33, 2.61, 1.55, 0.86, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.19, 0.3,
                     0.52, 0.69, 0.97, 1.3, 1.69, 2.08, 2.61, 3.05, 3.58, 4.02,
                     4.55, 5.0, 5.55, 5.97, 6.52, 6.94, 7.44, 7.83, 8.33, 8.72,
                     9.02, 9.22, 9.27, 9.36, 9.41, 9.5, 9.55, 9.63, 9.69, 9.77,
                     9.83, 9.91, 9.97, 10.16, 10.41, 10.66, 10.91, 11.11, 11.27, 11.41,
                     11.5, 11.55, 11.61, 11.61, 11.63, 11.63, 11.66, 11.66, 11.72, 11.74,
                     11.83, 11.94, 12.02, 12.13, 12.22, 12.3, 12.36, 12.38, 12.38, 12.36,
                     12.33, 12.3, 12.27, 12.25, 12.22, 12.19, 12.16, 12.13, 12.11, 12.08,
                     12.05, 12.02, 11.97, 11.91, 11.86, 11.8, 11.74, 11.72, 11.72, 11.72,
                     11.74, 11.77, 11.8, 11.86, 11.91, 11.97, 12.0, 12.02, 12.05, 12.05,
                     12.0, 11.91, 11.83, 11.72, 11.63, 11.52, 11.38, 11.25, 11.08, 10.91,
                     10.75, 10.58, 10.41, 10.25, 10.08, 9.91, 9.75, 9.58, 9.41, 9.33,
                     9.3, 9.33, 9.41, 9.52, 9.63, 9.75, 9.86, 9.97, 10.11, 10.25,
                     10.38, 10.52, 10.63, 10.75, 10.86, 10.91, 10.97, 11.02, 11.08, 11.11,
                     11.13, 11.16, 11.19, 11.22, 11.25, 11.25, 11.22, 11.19, 11.16, 11.13,
                     11.02, 10.77, 10.38, 9.88, 9.27, 8.66, 8.08, 7.66, 7.38, 7.27,
                     7.3, 7.41, 7.63, 7.88, 8.16, 8.44, 8.66, 8.86, 9.02, 9.16,
                     9.27, 9.38, 9.47, 9.52, 9.52, 9.41, 9.24, 9.05, 8.83, 8.52,
                     8.22, 7.94, 7.72, 7.5, 7.33, 7.16, 7.02, 6.91, 6.8, 6.72,
                     6.66, 6.61, 6.55, 6.52, 6.49, 6.47, 6.47, 6.44, 6.41, 6.38,
                     6.33, 6.25, 6.13, 6.02, 5.86, 5.66, 5.41, 5.13, 4.88, 4.61,
                     4.36, 4.13, 3.97, 3.91, 3.88, 3.86, 3.83, 3.8, 3.77, 3.75,
                     3.72, 3.69, 3.66, 3.66, 3.66, 3.72, 3.75, 3.8, 3.83, 3.88,
                     3.91, 3.97, 4.0, 4.0, 4.0, 3.97, 3.97, 3.88, 3.61, 3.16,
                     2.83, 2.22, 1.94, 1.66, 1.52, 1.38, 1.25, 1.11, 0.97, 0.83,
                     0.69, 0.55, 0.41, 0.27, 0.13, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.61, 1.25, 1.83, 2.38, 2.94, 3.47, 4.0, 4.52, 4.97,
                     5.3, 5.52, 5.63, 5.69, 5.75, 5.83, 6.0, 6.27, 6.58, 6.88,
                     7.13, 7.27, 7.33, 7.33, 7.33, 7.36, 7.38, 7.44, 7.47, 7.55,
                     7.63, 7.77, 8.0, 8.3, 8.61, 8.86, 9.02, 9.05, 9.0, 8.88,
                     8.69, 8.41, 7.77, 7.5, 6.66, 6.25, 5.27, 4.86, 3.88, 3.47,
                     2.5, 2.08, 1.11, 0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.44, 0.86, 1.27, 1.69, 2.16, 2.63, 3.13, 3.66, 4.16,
                     4.66, 5.11, 5.58, 6.0, 6.41, 6.83, 7.22, 7.63, 8.05, 8.5,
                     8.91, 9.36, 9.8, 10.22, 10.58, 10.91, 11.22, 11.44, 11.63, 11.83,
                     12.02, 12.22, 12.38, 12.58, 12.63, 12.63, 12.55, 12.41, 12.27, 12.11,
                     11.97, 11.88, 11.86, 11.88, 12.02, 12.19, 12.38, 12.61, 12.86, 13.11,
                     13.27, 13.38, 13.47, 13.52, 13.58, 13.63, 13.63, 13.61, 13.55, 13.5,
                     13.47, 13.44, 13.41, 13.38, 13.36, 13.19, 12.97, 12.69, 12.38, 11.91,
                     11.33, 10.61, 9.8, 8.83, 7.97, 7.16, 6.36, 5.61, 4.8, 4.16,
                     3.41, 2.86, 2.16, 1.8, 1.22, 0.88, 0.33, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.16, 0.52, 0.75, 1.44, 1.94, 2.66, 3.16, 3.91, 4.38, 5.05,
                     5.47, 6.05, 6.44, 6.86, 7.16, 7.41, 7.55, 7.69, 7.8, 7.88,
                     7.97, 8.05, 8.11, 8.16, 8.16, 8.13, 8.02, 7.91, 7.8, 7.66,
                     7.47, 7.22, 6.83, 6.33, 5.83, 5.41, 5.16, 5.11, 5.27, 5.58,
                     5.97, 6.41, 6.91, 7.33, 7.74, 8.11, 8.44, 8.77, 9.11, 9.44,
                     9.75, 10.08, 10.38, 10.72, 11.0, 11.27, 11.55, 11.77, 11.94, 12.11,
                     12.22, 12.33, 12.44, 12.55, 12.66, 12.77, 12.91, 13.05, 13.19, 13.33,
                     13.5, 13.63, 13.8, 13.94, 14.11, 14.24, 14.38, 14.52, 14.69, 14.83,
                     15.0, 15.13, 15.3, 15.44, 15.61, 15.75, 15.91, 16.08, 16.22, 16.33,
                     16.36, 16.22, 16.13, 16.0, 15.8, 15.63, 15.47, 15.36, 15.27, 15.19,
                     15.13, 15.11, 15.08, 15.05, 15.02, 14.94, 14.86, 14.72, 14.61, 14.5,
                     14.41, 14.36, 14.36, 14.38, 14.44, 14.52, 14.61, 14.69, 14.75, 14.77,
                     14.8, 14.8, 14.83, 14.86, 14.91, 15.0, 15.11, 15.25, 15.44, 15.63,
                     15.86, 16.08, 16.33, 16.55, 16.75, 16.91, 17.02, 17.13, 17.16, 17.16,
                     17.11, 17.0, 16.88, 16.77, 16.63, 16.5, 16.36, 16.27, 16.16, 16.08,
                     16.02, 15.97, 15.88, 15.83, 15.77, 15.72, 15.72, 15.75, 15.86, 16.0,
                     16.16, 16.38, 16.61, 16.83, 17.05, 17.27, 17.47, 17.63, 17.83, 17.88,
                     17.88, 17.77, 17.63, 17.47, 17.33, 17.22, 17.11, 17.05, 17.0, 16.94,
                     16.86, 16.72, 16.55, 16.36, 16.13, 15.88, 15.63, 15.36, 15.11, 14.83,
                     14.55, 14.27, 14.0, 13.72, 13.47, 13.19, 12.91, 12.61, 12.3, 11.97,
                     11.66, 11.33, 11.02, 10.77, 10.58, 10.38, 10.3, 10.25, 10.27, 10.41,
                     10.49, 10.61, 10.72, 10.86, 11.0, 11.13, 11.3, 11.47, 11.63, 11.86,
                     12.05, 12.27, 12.5, 12.75, 12.99, 13.25, 13.52, 13.8, 14.05, 14.33,
                     14.58, 14.8, 15.02, 15.19, 15.36, 15.47, 15.58, 15.66, 15.75, 15.86,
                     15.97, 16.11, 16.3, 16.47, 16.66, 16.83, 17.02, 17.08, 17.08, 17.05,
                     17.0, 16.8, 16.66, 16.52, 16.36, 16.22, 16.08, 15.97, 15.86, 15.75,
                     15.66, 15.58, 15.49, 15.41, 15.36, 15.27, 15.19, 15.11, 15.05, 15.0,
                     14.97, 14.91, 14.88, 14.86, 14.83, 14.8, 14.77, 14.75, 14.72, 14.72,
                     14.72, 14.72, 14.72, 14.72, 14.66, 14.58, 14.41, 14.19, 13.94, 13.66,
                     13.38, 13.13, 12.88, 12.66, 12.5, 12.3, 12.16, 12.02, 11.88, 11.77,
                     11.66, 11.55, 11.41, 11.19, 10.97, 10.72, 10.47, 10.19, 10.05, 10.0,
                     10.05, 10.27, 10.55, 10.83, 11.02, 11.16, 11.3, 11.44, 11.58, 11.72,
                     11.86, 12.0, 12.11, 12.22, 12.27, 12.33, 12.36, 12.38, 12.41, 12.38,
                     12.36, 12.33, 12.27, 12.25, 12.13, 12.02, 11.88, 11.74, 11.55, 11.3,
                     11.05, 10.77, 10.49, 10.25, 10.02, 9.86, 9.72, 9.63, 9.55, 9.47,
                     9.41, 9.33, 9.24, 9.16, 9.08, 8.97, 8.86, 8.75, 8.61, 8.5,
                     8.38, 8.25, 8.08, 7.88, 7.66, 7.44, 7.22, 6.97, 6.72, 6.47,
                     6.22, 5.97, 5.72, 5.47, 5.22, 4.91, 4.55, 4.13, 3.66, 3.13,
                     2.61, 2.08, 1.55, 1.02, 0.52, 0.27, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, ]

        def function(t):
            te = len(self.data)-1  # End time of data
            if t < te:
                ti = int(t)
                # Linear interpolation between two points
                return self.data[ti]*(1+ti-t)+self.data[ti+1]*(t-ti)
            else:
                return 0.
        self.function = function


class WLTP2(Signal):
    """
    WLTP classe 2 cycle
    Caution! speed in m/s, not in km/h!
    """

    def __init__(self, name):
        Signal.__init__(self, name)
        self.data = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.33, 0.72, 1.36, 2.02, 2.61, 3.16, 3.52,
                     3.69, 3.72, 3.69, 3.63, 3.47, 3.08, 2.47, 1.72, 1.05, 0.5,
                     0.0, 0.0, 0.0, 0.0, 0.41, 0.77, 1.0, 1.25, 1.47, 1.66,
                     1.83, 2.02, 2.19, 2.38, 2.58, 2.77, 3.0, 3.22, 3.44, 3.66,
                     3.94, 4.11, 4.08, 4.0, 3.91, 3.77, 3.61, 3.44, 3.27, 3.11,
                     2.94, 2.75, 2.5, 2.27, 1.94, 1.33, 0.63, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.22, 0.38, 0.63,
                     0.97, 1.3, 1.63, 2.05, 2.55, 3.24, 3.75, 4.16, 4.5, 4.66,
                     4.86, 5.22, 5.63, 6.11, 6.55, 6.88, 7.11, 7.3, 7.55, 7.86,
                     8.22, 8.58, 8.94, 9.27, 9.75, 10.33, 10.75, 10.83, 11.13, 11.22,
                     11.02, 10.22, 9.75, 8.94, 8.63, 8.55, 8.25, 8.16, 8.05, 7.91,
                     7.22, 6.49, 5.75, 4.83, 4.22, 3.75, 3.61, 3.44, 3.41, 3.38,
                     3.41, 3.44, 3.47, 3.52, 3.55, 3.66, 3.97, 4.58, 5.38, 6.02,
                     6.41, 6.52, 6.72, 6.88, 7.05, 7.16, 7.36, 7.55, 7.86, 8.3,
                     9.0, 9.75, 10.41, 10.88, 11.25, 11.5, 11.66, 11.8, 12.0, 12.33,
                     12.75, 13.22, 13.61, 13.88, 13.94, 13.91, 13.83, 13.72, 13.58, 13.47,
                     13.41, 13.38, 13.3, 13.08, 12.63, 12.0, 11.27, 10.69, 10.25, 9.97,
                     9.8, 9.66, 9.58, 9.5, 9.44, 9.38, 9.33, 9.3, 9.3, 9.27,
                     9.24, 9.24, 9.22, 9.19, 9.16, 9.13, 9.11, 9.08, 9.02, 8.97,
                     8.83, 8.72, 8.58, 8.5, 8.5, 8.52, 8.88, 9.3, 9.94, 10.44,
                     10.77, 11.0, 11.13, 11.36, 11.61, 12.02, 12.41, 12.88, 13.3, 13.77,
                     13.77, 13.55, 13.33, 13.19, 13.08, 13.02, 12.72, 12.72, 12.72, 12.75,
                     12.83, 12.88, 12.94, 12.99, 13.05, 13.13, 13.19, 13.3, 13.41, 13.41,
                     13.38, 13.33, 13.25, 13.11, 12.91, 12.55, 12.13, 11.66, 11.22, 10.83,
                     10.47, 10.11, 9.77, 9.52, 9.38, 9.24, 9.02, 8.58, 7.94, 7.19,
                     6.41, 5.58, 4.8, 4.19, 3.8, 3.72, 3.86, 4.16, 4.52, 4.83,
                     5.05, 5.16, 5.27, 5.38, 5.5, 5.58, 5.69, 5.61, 5.16, 4.58,
                     4.0, 3.72, 3.58, 3.52, 3.44, 3.44, 3.55, 3.91, 4.5, 5.22,
                     6.08, 6.94, 7.88, 8.69, 9.44, 9.61, 9.41, 8.86, 8.33, 8.05,
                     7.74, 7.52, 7.33, 7.19, 7.08, 6.94, 6.83, 6.63, 6.38, 6.05,
                     5.75, 5.44, 5.19, 5.02, 4.86, 4.63, 4.27, 3.77, 3.11, 2.38,
                     1.66, 0.86, 0.33, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.38, 0.88, 1.55, 2.25, 2.86, 3.36, 3.5, 3.77, 4.02, 4.33,
                     4.66, 5.05, 5.44, 5.8, 6.19, 6.61, 7.05, 7.5, 7.94, 8.38,
                     8.66, 8.66, 8.52, 8.19, 7.94, 7.69, 7.47, 7.25, 7.05, 6.83,
                     6.55, 6.27, 6.02, 5.75, 5.5, 5.22, 4.91, 4.61, 4.33, 4.11,
                     3.97, 3.83, 3.72, 3.63, 3.55, 3.41, 3.22, 2.91, 2.5, 2.0,
                     1.44, 0.8, 0.33, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.38, 0.69, 1.44, 2.19, 2.86, 3.52, 4.16, 4.83, 5.47,
                     6.08, 6.69, 7.27, 7.8, 8.25, 8.69, 9.16, 9.63, 10.08, 10.58,
                     10.94, 11.22, 11.44, 11.69, 12.0, 12.3, 12.69, 12.61, 12.36, 11.8,
                     10.97, 10.13, 9.3, 8.44, 7.5, 6.55, 5.83, 5.41, 4.88, 4.47,
                     4.02, 3.75, 3.8, 4.44, 5.02, 5.77, 5.97, 6.25, 6.49, 6.8,
                     7.11, 7.22, 7.36, 7.47, 7.58, 7.74, 8.41, 9.22, 9.83, 10.55,
                     11.13, 11.86, 12.36, 12.86, 13.22, 13.55, 13.8, 14.05, 14.27, 14.27,
                     13.94, 13.08, 12.36, 11.52, 10.69, 9.86, 9.02, 8.19, 7.36, 6.52,
                     5.66, 4.86, 4.02, 3.19, 2.36, 1.55, 0.72, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.44, 1.0, 1.75, 2.5, 3.27, 3.94, 4.61, 5.13, 5.77,
                     6.49, 7.47, 8.41, 9.11, 9.47, 9.5, 9.33, 8.91, 8.33, 7.63,
                     6.97, 6.33, 5.69, 4.97, 4.19, 3.72, 3.55, 3.8, 4.44, 5.02,
                     5.77, 6.58, 7.36, 8.13, 8.88, 9.58, 10.22, 10.72, 11.05, 11.27,
                     11.41, 11.63, 11.88, 12.3, 12.69, 13.16, 13.58, 14.05, 14.44, 14.91,
                     15.27, 15.77, 16.11, 16.61, 16.97, 17.33, 17.5, 17.63, 17.5, 17.22,
                     16.77, 16.27, 15.75, 15.27, 14.91, 14.63, 14.41, 14.27, 14.16, 14.08,
                     14.05, 14.11, 14.22, 14.36, 14.52, 14.75, 14.94, 15.13, 15.3, 15.52,
                     15.69, 15.86, 16.05, 16.25, 16.47, 16.72, 17.02, 17.33, 17.61, 17.88,
                     18.16, 18.41, 18.66, 18.88, 19.11, 19.3, 19.47, 19.61, 19.72, 19.88,
                     20.05, 20.22, 20.41, 20.58, 20.63, 20.63, 20.47, 19.97, 19.58, 19.13,
                     18.72, 18.33, 17.97, 17.69, 17.47, 17.27, 17.13, 17.0, 16.86, 16.75,
                     16.63, 16.55, 16.47, 16.38, 16.27, 16.11, 15.97, 15.8, 15.63, 15.52,
                     15.44, 15.36, 15.3, 15.22, 15.16, 15.13, 15.08, 14.97, 14.83, 14.61,
                     14.3, 13.94, 13.52, 13.05, 12.52, 11.94, 11.27, 10.58, 9.83, 9.08,
                     8.33, 7.63, 7.02, 6.49, 6.11, 5.77, 5.5, 5.24, 5.0, 4.72,
                     4.47, 4.3, 4.0, 4.13, 4.41, 4.75, 5.08, 5.38, 5.66, 5.88,
                     6.08, 6.3, 6.49, 6.72, 6.75, 6.72, 6.69, 6.61, 6.38, 6.27,
                     6.02, 5.91, 5.63, 5.3, 5.02, 4.69, 4.44, 4.11, 4.02, 3.8,
                     3.75, 3.58, 3.52, 3.47, 3.47, 3.5, 3.61, 3.77, 4.05, 4.36,
                     4.75, 5.19, 5.61, 6.08, 6.55, 7.05, 7.52, 8.02, 8.44, 8.88,
                     9.27, 9.72, 10.11, 10.58, 11.02, 11.55, 12.02, 12.52, 13.02, 13.52,
                     14.02, 14.55, 15.02, 15.47, 15.77, 16.08, 16.38, 16.63, 16.86, 17.05,
                     17.22, 17.36, 17.47, 17.55, 17.61, 17.69, 17.77, 17.88, 18.02, 18.19,
                     18.38, 18.61, 18.83, 19.05, 19.27, 19.47, 19.69, 19.91, 20.13, 20.33,
                     20.5, 20.66, 20.75, 20.75, 20.72, 20.61, 20.41, 20.16, 19.94, 19.72,
                     19.47, 19.27, 19.13, 19.0, 18.86, 18.63, 18.27, 17.75, 17.05, 16.22,
                     15.38, 14.55, 13.88, 13.41, 13.13, 12.99, 13.02, 13.08, 13.19, 13.27,
                     13.41, 13.55, 13.75, 13.94, 14.11, 14.27, 14.38, 14.41, 14.36, 14.22,
                     14.0, 13.66, 13.25, 12.86, 12.52, 12.27, 12.13, 12.05, 11.97, 11.8,
                     11.61, 11.41, 11.19, 11.02, 10.91, 10.88, 10.91, 11.0, 11.11, 11.3,
                     11.5, 11.72, 11.97, 12.25, 12.47, 12.66, 12.88, 13.05, 13.27, 13.41,
                     13.58, 13.72, 13.83, 13.77, 13.69, 13.61, 13.47, 13.33, 13.19, 13.05,
                     13.02, 12.99, 12.99, 12.99, 13.02, 13.02, 13.02, 13.02, 13.02, 12.99,
                     12.94, 12.88, 12.77, 12.63, 12.5, 12.36, 12.27, 12.19, 12.13, 12.11,
                     12.11, 12.08, 12.08, 12.05, 12.02, 11.97, 11.91, 11.86, 11.8, 11.77,
                     11.72, 11.69, 11.66, 11.61, 11.58, 11.52, 11.47, 11.41, 11.33, 11.19,
                     11.0, 10.69, 10.27, 9.75, 9.16, 8.5, 7.74, 6.97, 6.11, 5.22,
                     4.3, 3.41, 2.44, 1.66, 1.0, 0.44, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.83, 1.58,
                     2.33, 3.08, 3.88, 4.72, 5.58, 6.3, 6.55, 6.8, 6.88, 6.97,
                     7.02, 7.08, 7.13, 7.16, 7.19, 7.22, 7.25, 7.3, 7.36, 7.44,
                     7.52, 7.63, 7.77, 7.94, 8.13, 8.44, 8.83, 9.36, 9.94, 10.49,
                     10.97, 11.33, 11.61, 11.77, 11.94, 12.05, 12.22, 12.33, 12.5, 12.61,
                     12.77, 12.88, 13.05, 13.16, 13.33, 13.44, 13.61, 13.72, 13.88, 14.0,
                     14.11, 14.19, 14.24, 14.24, 14.24, 14.24, 14.24, 14.24, 14.24, 14.27,
                     14.33, 14.38, 14.47, 14.52, 14.61, 14.66, 14.69, 14.72, 14.72, 14.72,
                     14.75, 14.77, 14.8, 14.83, 14.86, 14.91, 15.27, 15.77, 16.33, 16.91,
                     17.5, 18.05, 18.58, 19.05, 19.47, 19.86, 20.22, 20.52, 20.8, 21.02,
                     21.22, 21.41, 21.55, 21.66, 21.72, 21.77, 21.8, 21.8, 21.83, 21.86,
                     21.91, 21.97, 22.05, 22.16, 22.24, 22.36, 22.44, 22.5, 22.55, 22.58,
                     22.55, 22.5, 22.38, 22.22, 21.97, 21.66, 21.33, 20.97, 20.58, 20.25,
                     19.97, 19.77, 19.69, 19.72, 19.86, 20.08, 20.33, 20.58, 20.8, 20.94,
                     20.97, 20.88, 20.69, 20.36, 19.91, 19.41, 18.86, 18.25, 17.63, 17.0,
                     16.38, 15.77, 15.19, 14.63, 14.13, 13.72, 13.36, 13.08, 12.91, 12.86,
                     12.91, 13.11, 13.41, 13.8, 14.24, 14.72, 15.25, 15.75, 16.27, 16.72,
                     17.11, 17.27, 17.36, 17.44, 17.47, 17.5, 17.5, 17.52, 17.55, 17.58,
                     17.63, 17.69, 17.75, 17.8, 17.86, 18.36, 18.86, 19.36, 19.83, 20.3,
                     20.75, 21.16, 21.52, 21.83, 22.13, 22.38, 22.63, 22.83, 23.05, 23.25,
                     23.44, 23.58, 23.63, 23.66, 23.58, 23.44, 23.22, 22.97, 22.63, 22.24,
                     21.86, 21.5, 21.16, 20.94, 20.77, 20.63, 20.5, 20.33, 20.11, 19.88,
                     19.66, 19.41, 18.86, 18.25, 17.63, 17.0, 16.38, 15.77, 15.19, 14.63,
                     14.13, 13.72, 13.36, 13.08, 12.91, 12.86, 12.52, 11.94, 11.27, 10.58,
                     9.83, 9.08, 8.33, 8.3, 8.33, 8.38, 8.44, 8.5, 8.77, 9.16,
                     9.41, 9.66, 9.91, 10.16, 10.41, 10.66, 10.91, 11.16, 11.33, 11.58,
                     11.77, 11.97, 12.11, 12.27, 12.44, 12.63, 12.86, 13.11, 13.36, 13.63,
                     13.88, 14.16, 14.41, 14.63, 14.91, 15.27, 15.77, 16.33, 16.91, 17.5,
                     18.05, 18.58, 19.05, 19.47, 19.72, 19.94, 20.22, 20.25, 20.27, 20.08,
                     19.97, 19.8, 19.69, 19.58, 19.44, 19.33, 19.22, 19.11, 19.0, 18.86,
                     18.75, 18.66, 18.55, 18.22, 17.58, 16.72, 15.61, 14.5, 13.44, 12.5,
                     11.55, 10.72, 10.11, 9.66, 9.5, 9.63, 10.08, 10.69, 11.38, 12.13,
                     12.91, 13.63, 14.33, 14.97, 15.55, 16.08, 16.58, 17.0, 17.36, 17.63,
                     17.86, 18.13, 18.41, 18.69, 18.97, 19.25, 19.52, 19.66, 19.66, 19.66,
                     19.69, 19.69, 19.69, 19.69, 19.72, 19.72, 19.74, 19.77, 19.8, 19.83,
                     19.86, 19.91, 19.94, 19.97, 19.97, 19.97, 19.97, 19.97, 19.97, 19.97,
                     20.0, 20.02, 20.11, 20.19, 20.3, 20.38, 20.5, 20.55, 20.58, 20.55,
                     20.27, 20.0, 19.72, 19.44, 19.16, 18.88, 18.8, 18.52, 18.49, 18.52,
                     18.55, 18.58, 18.58, 18.58, 18.58, 18.58, 18.58, 18.58, 18.61, 18.63,
                     18.69, 18.75, 18.83, 18.94, 19.05, 19.16, 19.25, 19.25, 19.22, 19.11,
                     18.94, 18.77, 18.72, 18.66, 18.58, 18.41, 18.16, 17.77, 17.33, 16.83,
                     16.27, 15.75, 15.22, 14.72, 14.24, 13.77, 13.27, 12.63, 11.88, 11.05,
                     10.13, 9.16, 8.19, 7.16, 6.13, 5.16, 4.25, 3.44, 2.66, 1.83,
                     1.05, 0.44, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3,
                     0.63, 1.27, 1.8, 2.47, 3.02, 3.75, 4.22, 4.88, 5.36, 5.94,
                     6.38, 6.94, 7.36, 7.88, 8.27, 8.8, 9.36, 9.94, 10.58, 11.25,
                     11.72, 12.08, 12.36, 12.55, 12.72, 12.94, 13.16, 13.47, 13.8, 14.24,
                     14.69, 15.08, 15.44, 15.77, 16.08, 16.36, 16.58, 16.75, 16.86, 16.91,
                     16.94, 16.97, 17.05, 17.16, 17.36, 17.61, 17.91, 18.25, 18.58, 18.91,
                     19.19, 19.44, 19.69, 19.94, 20.16, 20.38, 20.55, 20.75, 20.88, 21.02,
                     21.22, 21.44, 21.72, 21.91, 22.19, 22.52, 22.88, 23.25, 23.72, 24.16,
                     24.52, 24.86, 25.13, 25.36, 25.61, 25.83, 26.05, 26.27, 26.47, 26.63,
                     26.83, 27.05, 27.24, 27.41, 27.63, 27.86, 28.08, 28.3, 28.55, 28.83,
                     29.16, 29.47, 29.83, 30.19, 30.52, 30.88, 31.19, 31.5, 31.77, 32.02,
                     32.25, 32.44, 32.61, 32.69, 32.83, 32.8, 32.69, 32.5, 32.25, 32.0,
                     31.77, 31.55, 31.38, 31.27, 31.16, 31.08, 30.99, 30.88, 30.75, 30.58,
                     30.36, 30.11, 29.83, 29.63, 29.52, 29.5, 29.55, 29.72, 29.86, 29.97,
                     30.11, 30.25, 30.41, 30.61, 30.8, 30.99, 31.16, 31.33, 31.47, 31.58,
                     31.69, 31.77, 31.83, 31.86, 31.86, 31.86, 31.83, 31.8, 31.8, 31.8,
                     31.86, 31.94, 32.11, 32.33, 32.58, 32.83, 33.0, 33.13, 33.22, 33.25,
                     33.19, 33.13, 33.11, 33.05, 33.0, 33.0, 33.0, 33.0, 33.0, 33.02,
                     33.05, 33.05, 33.08, 33.11, 33.16, 33.22, 33.3, 33.36, 33.41, 33.44,
                     33.47, 33.47, 33.47, 33.47, 33.44, 33.41, 33.36, 33.3, 33.22, 33.19,
                     33.16, 33.13, 33.13, 33.16, 33.19, 33.19, 33.22, 33.22, 33.22, 33.16,
                     33.13, 33.05, 33.0, 32.97, 33.0, 33.05, 33.11, 33.22, 33.33, 33.41,
                     33.47, 33.52, 33.58, 33.61, 33.63, 33.66, 33.69, 33.72, 33.75, 33.75,
                     33.75, 33.72, 33.69, 33.63, 33.58, 33.5, 33.44, 33.38, 33.36, 33.3,
                     33.27, 33.27, 33.3, 33.33, 33.38, 33.44, 33.55, 33.63, 33.77, 33.83,
                     33.91, 34.0, 34.08, 34.11, 34.19, 34.19, 34.11, 33.97, 33.69, 33.3,
                     32.8, 32.19, 31.52, 30.86, 30.16, 29.5, 28.88, 28.08, 27.3, 26.58,
                     25.97, 25.41, 25.19, 25.11, 25.05, 25.05, 25.02, 25.0, 24.94, 24.88,
                     24.83, 24.77, 24.69, 24.58, 24.47, 24.33, 24.19, 24.05, 23.91, 23.75,
                     23.61, 23.44, 23.27, 23.11, 22.94, 22.75, 22.52, 22.22, 21.86, 21.36,
                     20.72, 20.0, 19.16, 18.22, 17.25, 16.25, 15.19, 14.13, 13.13, 12.16,
                     11.22, 10.38, 9.52, 8.69, 7.86, 7.0, 6.11, 5.24, 4.47, 3.72,
                     3.08, 2.47, 1.91, 1.36, 0.77, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, ]

        def function(t):
            te = len(self.data)-1  # End time of data
            if t < te:
                ti = int(t)
                # Linear interpolation between two points
                return self.data[ti]*(1+ti-t)+self.data[ti+1]*(t-ti)
            else:
                return 0.
        self.function = function


class WLTP3(Signal):
    """
    WLTP classe 3 cycle
    Caution! speed in m/s, not in km/h!
    """

    def __init__(self, name):
        Signal.__init__(self, name)
        self.data = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.33, 0.72, 1.36, 2.02, 2.61, 3.16, 3.52,
                     3.69, 3.72, 3.69, 3.63, 3.47, 3.08, 2.47, 1.72, 1.05, 0.5,
                     0.0, 0.0, 0.0, 0.0, 0.41, 0.77, 1.0, 1.25, 1.47, 1.66,
                     1.83, 2.02, 2.19, 2.38, 2.58, 2.77, 3.0, 3.22, 3.44, 3.66,
                     3.94, 4.11, 4.08, 4.0, 3.91, 3.77, 3.61, 3.44, 3.27, 3.11,
                     2.94, 2.75, 2.5, 2.27, 1.94, 1.33, 0.63, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.22, 0.38, 0.63,
                     0.97, 1.3, 1.63, 2.05, 2.55, 3.24, 3.75, 4.16, 4.5, 4.66,
                     4.86, 5.22, 5.63, 6.11, 6.55, 6.88, 7.11, 7.3, 7.55, 7.86,
                     8.22, 8.58, 8.94, 9.27, 9.75, 10.33, 10.75, 10.83, 11.13, 11.22,
                     11.02, 10.22, 9.75, 8.94, 8.63, 8.55, 8.25, 8.16, 8.05, 7.91,
                     7.22, 6.49, 5.75, 4.83, 4.22, 3.75, 3.61, 3.44, 3.41, 3.38,
                     3.41, 3.44, 3.47, 3.52, 3.55, 3.66, 3.97, 4.58, 5.38, 6.02,
                     6.41, 6.52, 6.72, 6.88, 7.05, 7.16, 7.36, 7.55, 7.86, 8.3,
                     9.0, 9.75, 10.41, 10.88, 11.25, 11.5, 11.66, 11.8, 12.0, 12.33,
                     12.75, 13.22, 13.61, 13.88, 13.94, 13.91, 13.83, 13.72, 13.58, 13.47,
                     13.41, 13.38, 13.3, 13.08, 12.63, 12.0, 11.27, 10.69, 10.25, 9.97,
                     9.8, 9.66, 9.58, 9.5, 9.44, 9.38, 9.33, 9.3, 9.3, 9.27,
                     9.24, 9.24, 9.22, 9.19, 9.16, 9.13, 9.11, 9.08, 9.02, 8.97,
                     8.83, 8.72, 8.58, 8.5, 8.5, 8.52, 8.88, 9.3, 9.94, 10.44,
                     10.77, 11.0, 11.13, 11.36, 11.61, 12.02, 12.41, 12.88, 13.3, 13.77,
                     13.77, 13.55, 13.33, 13.19, 13.08, 13.02, 12.72, 12.72, 12.72, 12.75,
                     12.83, 12.88, 12.94, 12.99, 13.05, 13.13, 13.19, 13.3, 13.41, 13.41,
                     13.38, 13.33, 13.25, 13.11, 12.91, 12.55, 12.13, 11.66, 11.22, 10.83,
                     10.47, 10.11, 9.77, 9.52, 9.38, 9.24, 9.02, 8.58, 7.94, 7.19,
                     6.41, 5.58, 4.8, 4.19, 3.8, 3.72, 3.86, 4.16, 4.52, 4.83,
                     5.05, 5.16, 5.27, 5.38, 5.5, 5.58, 5.69, 5.61, 5.16, 4.58,
                     4.0, 3.72, 3.58, 3.52, 3.44, 3.44, 3.55, 3.91, 4.5, 5.22,
                     6.08, 6.94, 7.88, 8.69, 9.44, 9.61, 9.41, 8.86, 8.33, 8.05,
                     7.74, 7.52, 7.33, 7.19, 7.08, 6.94, 6.83, 6.63, 6.38, 6.05,
                     5.75, 5.44, 5.19, 5.02, 4.86, 4.63, 4.27, 3.77, 3.11, 2.38,
                     1.66, 0.86, 0.33, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.38, 0.88, 1.55, 2.25, 2.86, 3.36, 3.5, 3.77, 4.02, 4.33,
                     4.66, 5.05, 5.44, 5.8, 6.19, 6.61, 7.05, 7.5, 7.94, 8.38,
                     8.66, 8.66, 8.52, 8.19, 7.94, 7.69, 7.47, 7.25, 7.05, 6.83,
                     6.55, 6.27, 6.02, 5.75, 5.5, 5.22, 4.91, 4.61, 4.33, 4.11,
                     3.97, 3.83, 3.72, 3.63, 3.55, 3.41, 3.22, 2.91, 2.5, 2.0,
                     1.44, 0.8, 0.33, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.38, 0.69, 1.44, 2.19, 2.86, 3.52, 4.16, 4.83, 5.47,
                     6.08, 6.69, 7.27, 7.8, 8.25, 8.69, 9.16, 9.63, 10.08, 10.58,
                     10.94, 11.22, 11.44, 11.69, 12.0, 12.3, 12.69, 12.61, 12.36, 11.8,
                     10.97, 10.13, 9.3, 8.44, 7.5, 6.55, 5.83, 5.41, 4.88, 4.47,
                     4.02, 3.75, 3.8, 4.44, 5.02, 5.77, 5.97, 6.25, 6.49, 6.8,
                     7.11, 7.22, 7.36, 7.47, 7.58, 7.74, 8.41, 9.22, 9.83, 10.55,
                     11.13, 11.86, 12.36, 12.86, 13.22, 13.55, 13.8, 14.05, 14.27, 14.27,
                     13.94, 13.08, 12.36, 11.52, 10.69, 9.86, 9.02, 8.19, 7.36, 6.52,
                     5.66, 4.86, 4.02, 3.19, 2.36, 1.55, 0.72, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.44, 1.0, 1.75, 2.5, 3.27, 3.94, 4.61, 5.13, 5.77,
                     6.49, 7.47, 8.41, 9.11, 9.47, 9.5, 9.33, 8.91, 8.33, 7.63,
                     6.97, 6.33, 5.69, 4.97, 4.19, 3.72, 3.55, 3.8, 4.44, 5.02,
                     5.77, 6.58, 7.36, 8.13, 8.88, 9.58, 10.22, 10.72, 11.05, 11.27,
                     11.41, 11.63, 11.88, 12.3, 12.69, 13.16, 13.58, 14.05, 14.44, 14.91,
                     15.27, 15.77, 16.11, 16.61, 16.97, 17.33, 17.5, 17.63, 17.5, 17.22,
                     16.77, 16.27, 15.75, 15.27, 14.91, 14.63, 14.41, 14.27, 14.16, 14.08,
                     14.05, 14.11, 14.22, 14.36, 14.52, 14.75, 14.94, 15.13, 15.3, 15.52,
                     15.69, 15.86, 16.05, 16.25, 16.47, 16.72, 17.02, 17.33, 17.61, 17.88,
                     18.16, 18.41, 18.66, 18.88, 19.11, 19.3, 19.47, 19.61, 19.72, 19.88,
                     20.05, 20.22, 20.41, 20.58, 20.63, 20.63, 20.47, 19.97, 19.58, 19.13,
                     18.72, 18.33, 17.97, 17.69, 17.47, 17.27, 17.13, 17.0, 16.86, 16.75,
                     16.63, 16.55, 16.47, 16.38, 16.27, 16.11, 15.97, 15.8, 15.63, 15.52,
                     15.44, 15.36, 15.3, 15.22, 15.16, 15.13, 15.08, 14.97, 14.83, 14.61,
                     14.3, 13.94, 13.52, 13.05, 12.52, 11.94, 11.27, 10.58, 9.83, 9.08,
                     8.33, 7.63, 7.02, 6.49, 6.11, 5.77, 5.5, 5.24, 5.0, 4.72,
                     4.47, 4.3, 4.0, 4.13, 4.41, 4.75, 5.08, 5.38, 5.66, 5.88,
                     6.08, 6.3, 6.49, 6.72, 6.75, 6.72, 6.69, 6.61, 6.38, 6.27,
                     6.02, 5.91, 5.63, 5.3, 5.02, 4.69, 4.44, 4.11, 4.02, 3.8,
                     3.75, 3.58, 3.52, 3.47, 3.47, 3.5, 3.61, 3.77, 4.05, 4.36,
                     4.75, 5.19, 5.61, 6.08, 6.55, 7.05, 7.52, 8.02, 8.44, 8.88,
                     9.27, 9.72, 10.11, 10.58, 11.02, 11.55, 12.02, 12.52, 13.02, 13.52,
                     14.02, 14.55, 15.02, 15.47, 15.77, 16.08, 16.38, 16.63, 16.86, 17.05,
                     17.22, 17.36, 17.47, 17.55, 17.61, 17.69, 17.77, 17.88, 18.02, 18.19,
                     18.38, 18.61, 18.83, 19.05, 19.27, 19.47, 19.69, 19.91, 20.13, 20.33,
                     20.5, 20.66, 20.75, 20.75, 20.72, 20.61, 20.41, 20.16, 19.94, 19.72,
                     19.47, 19.27, 19.13, 19.0, 18.86, 18.63, 18.27, 17.75, 17.05, 16.22,
                     15.38, 14.55, 13.88, 13.41, 13.13, 12.99, 13.02, 13.08, 13.19, 13.27,
                     13.41, 13.55, 13.75, 13.94, 14.11, 14.27, 14.38, 14.41, 14.36, 14.22,
                     14.0, 13.66, 13.25, 12.86, 12.52, 12.27, 12.13, 12.05, 11.97, 11.8,
                     11.61, 11.41, 11.19, 11.02, 10.91, 10.88, 10.91, 11.0, 11.11, 11.3,
                     11.5, 11.72, 11.97, 12.25, 12.47, 12.66, 12.88, 13.05, 13.27, 13.41,
                     13.58, 13.72, 13.83, 13.77, 13.69, 13.61, 13.47, 13.33, 13.19, 13.05,
                     13.02, 12.99, 12.99, 12.99, 13.02, 13.02, 13.02, 13.02, 13.02, 12.99,
                     12.94, 12.88, 12.77, 12.63, 12.5, 12.36, 12.27, 12.19, 12.13, 12.11,
                     12.11, 12.08, 12.08, 12.05, 12.02, 11.97, 11.91, 11.86, 11.8, 11.77,
                     11.72, 11.69, 11.66, 11.61, 11.58, 11.52, 11.47, 11.41, 11.33, 11.19,
                     11.0, 10.69, 10.27, 9.75, 9.16, 8.5, 7.74, 6.97, 6.11, 5.22,
                     4.3, 3.41, 2.44, 1.66, 1.0, 0.44, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.83, 1.58,
                     2.33, 3.08, 3.88, 4.72, 5.58, 6.3, 6.55, 6.8, 6.88, 6.97,
                     7.02, 7.08, 7.13, 7.16, 7.19, 7.22, 7.25, 7.3, 7.36, 7.44,
                     7.52, 7.63, 7.77, 7.94, 8.13, 8.44, 8.83, 9.36, 9.94, 10.49,
                     10.97, 11.33, 11.61, 11.77, 11.94, 12.05, 12.22, 12.33, 12.5, 12.61,
                     12.77, 12.88, 13.05, 13.16, 13.33, 13.44, 13.61, 13.72, 13.88, 14.0,
                     14.11, 14.19, 14.24, 14.24, 14.24, 14.24, 14.24, 14.24, 14.24, 14.27,
                     14.33, 14.38, 14.47, 14.52, 14.61, 14.66, 14.69, 14.72, 14.72, 14.72,
                     14.75, 14.77, 14.8, 14.83, 14.86, 14.91, 15.27, 15.77, 16.33, 16.91,
                     17.5, 18.05, 18.58, 19.05, 19.47, 19.86, 20.22, 20.52, 20.8, 21.02,
                     21.22, 21.41, 21.55, 21.66, 21.72, 21.77, 21.8, 21.8, 21.83, 21.86,
                     21.91, 21.97, 22.05, 22.16, 22.24, 22.36, 22.44, 22.5, 22.55, 22.58,
                     22.55, 22.5, 22.38, 22.22, 21.97, 21.66, 21.33, 20.97, 20.58, 20.25,
                     19.97, 19.77, 19.69, 19.72, 19.86, 20.08, 20.33, 20.58, 20.8, 20.94,
                     20.97, 20.88, 20.69, 20.36, 19.91, 19.41, 18.86, 18.25, 17.63, 17.0,
                     16.38, 15.77, 15.19, 14.63, 14.13, 13.72, 13.36, 13.08, 12.91, 12.86,
                     12.91, 13.11, 13.41, 13.8, 14.24, 14.72, 15.25, 15.75, 16.27, 16.72,
                     17.11, 17.27, 17.36, 17.44, 17.47, 17.5, 17.5, 17.52, 17.55, 17.58,
                     17.63, 17.69, 17.75, 17.8, 17.86, 18.36, 18.86, 19.36, 19.83, 20.3,
                     20.75, 21.16, 21.52, 21.83, 22.13, 22.38, 22.63, 22.83, 23.05, 23.25,
                     23.44, 23.58, 23.63, 23.66, 23.58, 23.44, 23.22, 22.97, 22.63, 22.24,
                     21.86, 21.5, 21.16, 20.94, 20.77, 20.63, 20.5, 20.33, 20.11, 19.88,
                     19.66, 19.41, 18.86, 18.25, 17.63, 17.0, 16.38, 15.77, 15.19, 14.63,
                     14.13, 13.72, 13.36, 13.08, 12.91, 12.86, 12.52, 11.94, 11.27, 10.58,
                     9.83, 9.08, 8.33, 8.3, 8.33, 8.38, 8.44, 8.5, 8.77, 9.16,
                     9.41, 9.66, 9.91, 10.16, 10.41, 10.66, 10.91, 11.16, 11.33, 11.58,
                     11.77, 11.97, 12.11, 12.27, 12.44, 12.63, 12.86, 13.11, 13.36, 13.63,
                     13.88, 14.16, 14.41, 14.63, 14.91, 15.27, 15.77, 16.33, 16.91, 17.5,
                     18.05, 18.58, 19.05, 19.47, 19.72, 19.94, 20.22, 20.25, 20.27, 20.08,
                     19.97, 19.8, 19.69, 19.58, 19.44, 19.33, 19.22, 19.11, 19.0, 18.86,
                     18.75, 18.66, 18.55, 18.22, 17.58, 16.72, 15.61, 14.5, 13.44, 12.5,
                     11.55, 10.72, 10.11, 9.66, 9.5, 9.63, 10.08, 10.69, 11.38, 12.13,
                     12.91, 13.63, 14.33, 14.97, 15.55, 16.08, 16.58, 17.0, 17.36, 17.63,
                     17.86, 18.13, 18.41, 18.69, 18.97, 19.25, 19.52, 19.66, 19.66, 19.66,
                     19.69, 19.69, 19.69, 19.69, 19.72, 19.72, 19.74, 19.77, 19.8, 19.83,
                     19.86, 19.91, 19.94, 19.97, 19.97, 19.97, 19.97, 19.97, 19.97, 19.97,
                     20.0, 20.02, 20.11, 20.19, 20.3, 20.38, 20.5, 20.55, 20.58, 20.55,
                     20.27, 20.0, 19.72, 19.44, 19.16, 18.88, 18.8, 18.52, 18.49, 18.52,
                     18.55, 18.58, 18.58, 18.58, 18.58, 18.58, 18.58, 18.58, 18.61, 18.63,
                     18.69, 18.75, 18.83, 18.94, 19.05, 19.16, 19.25, 19.25, 19.22, 19.11,
                     18.94, 18.77, 18.72, 18.66, 18.58, 18.41, 18.16, 17.77, 17.33, 16.83,
                     16.27, 15.75, 15.22, 14.72, 14.24, 13.77, 13.27, 12.63, 11.88, 11.05,
                     10.13, 9.16, 8.19, 7.16, 6.13, 5.16, 4.25, 3.44, 2.66, 1.83,
                     1.05, 0.44, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3,
                     0.63, 1.27, 1.8, 2.47, 3.02, 3.75, 4.22, 4.88, 5.36, 5.94,
                     6.38, 6.94, 7.36, 7.88, 8.27, 8.8, 9.36, 9.94, 10.58, 11.25,
                     11.72, 12.08, 12.36, 12.55, 12.72, 12.94, 13.16, 13.47, 13.8, 14.24,
                     14.69, 15.08, 15.44, 15.77, 16.08, 16.36, 16.58, 16.75, 16.86, 16.91,
                     16.94, 16.97, 17.05, 17.16, 17.36, 17.61, 17.91, 18.25, 18.58, 18.91,
                     19.19, 19.44, 19.69, 19.94, 20.16, 20.38, 20.55, 20.75, 20.88, 21.02,
                     21.22, 21.44, 21.72, 21.91, 22.19, 22.52, 22.88, 23.25, 23.72, 24.16,
                     24.52, 24.86, 25.13, 25.36, 25.61, 25.83, 26.05, 26.27, 26.47, 26.63,
                     26.83, 27.05, 27.24, 27.41, 27.63, 27.86, 28.08, 28.3, 28.55, 28.83,
                     29.16, 29.47, 29.83, 30.19, 30.52, 30.88, 31.19, 31.5, 31.77, 32.02,
                     32.25, 32.44, 32.61, 32.69, 32.83, 32.8, 32.69, 32.5, 32.25, 32.0,
                     31.77, 31.55, 31.38, 31.27, 31.16, 31.08, 30.99, 30.88, 30.75, 30.58,
                     30.36, 30.11, 29.83, 29.63, 29.52, 29.5, 29.55, 29.72, 29.86, 29.97,
                     30.11, 30.25, 30.41, 30.61, 30.8, 30.99, 31.16, 31.33, 31.47, 31.58,
                     31.69, 31.77, 31.83, 31.86, 31.86, 31.86, 31.83, 31.8, 31.8, 31.8,
                     31.86, 31.94, 32.11, 32.33, 32.58, 32.83, 33.0, 33.13, 33.22, 33.25,
                     33.19, 33.13, 33.11, 33.05, 33.0, 33.0, 33.0, 33.0, 33.0, 33.02,
                     33.05, 33.05, 33.08, 33.11, 33.16, 33.22, 33.3, 33.36, 33.41, 33.44,
                     33.47, 33.47, 33.47, 33.47, 33.44, 33.41, 33.36, 33.3, 33.22, 33.19,
                     33.16, 33.13, 33.13, 33.16, 33.19, 33.19, 33.22, 33.22, 33.22, 33.16,
                     33.13, 33.05, 33.0, 32.97, 33.0, 33.05, 33.11, 33.22, 33.33, 33.41,
                     33.47, 33.52, 33.58, 33.61, 33.63, 33.66, 33.69, 33.72, 33.75, 33.75,
                     33.75, 33.72, 33.69, 33.63, 33.58, 33.5, 33.44, 33.38, 33.36, 33.3,
                     33.27, 33.27, 33.3, 33.33, 33.38, 33.44, 33.55, 33.63, 33.77, 33.83,
                     33.91, 34.0, 34.08, 34.11, 34.19, 34.19, 34.11, 33.97, 33.69, 33.3,
                     32.8, 32.19, 31.52, 30.86, 30.16, 29.5, 28.88, 28.08, 27.3, 26.58,
                     25.97, 25.41, 25.19, 25.11, 25.05, 25.05, 25.02, 25.0, 24.94, 24.88,
                     24.83, 24.77, 24.69, 24.58, 24.47, 24.33, 24.19, 24.05, 23.91, 23.75,
                     23.61, 23.44, 23.27, 23.11, 22.94, 22.75, 22.52, 22.22, 21.86, 21.36,
                     20.72, 20.0, 19.16, 18.22, 17.25, 16.25, 15.19, 14.13, 13.13, 12.16,
                     11.22, 10.38, 9.52, 8.69, 7.86, 7.0, 6.11, 5.24, 4.47, 3.72,
                     3.08, 2.47, 1.91, 1.36, 0.77, 0.0, 0.0, 0.0, 0.0, 0.0,
                     0.0, ]

        def function(t):
            te = len(self.data)-1  # End time of data
            if t < te:
                ti = int(t)
                # Linear interpolation between two points
                return self.data[ti]*(1+ti-t)+self.data[ti+1]*(t-ti)
            else:
                return 0.
        self.function = function
